package compiler.terminals;

import compiler.HowlToken;
import compiler.HowlType;
import compiler.TokenReader;
import compiler.exceptions.HowlParserException;

/**
 * Class to represent the name of data provider, as used by the register and
 * deregister statements.
 * 
 * 
 * @author Sarah Mount <s.mount@wlv.ac.uk>
 * @version 16 Dec 2009
 * 
 * @see compiler.nonterminals.RegisterStmt
 * @see compiler.nonterminals.DeregisterStmt
 */
public class DataProvider extends HowlToken {

	private String name;

	public DataProvider(TokenReader tokenReader) {
		super(tokenReader);
	}

	@Override
	public String codeGenerate() {
		return this.name;
	}

	@Override
	public HowlToken parse() throws HowlParserException {
		this.name = this.tokenReader.consumeToken();
		return this;
	}

	@Override
	public String toString() {
		return this.name;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}


}
